#include <cstdio>
#include <iostream>
using namespace std;

int main() 
{
	freopen("statis.in", "r", stdin);
	freopen("statis.out", "w", stdout);
	long long n = 0, a = 0, cnt = 0;
	cin >> n >> a;
	long long d = 0, s = 0;
	for ( long long i = 0; i < n; i++ ) {
		cin >> d;
		if ( d % a == 0 ) {
			cnt ++;
			s += d;
		}
	}
	cout << cnt << endl;
	cout << s << endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}
